package com.qnw.CardGroupManagement.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import java.util.List;
import java.util.Map;
import android.content.Context;
import com.ygo.feihua.Gongju;
import android.widget.TextView;
import android.view.LayoutInflater;
import com.ygo.feihua.R;

public class AdapterCombo extends BaseAdapter
{
	private List<Map<String,Object>> data;
	private Context context;
	private Zujian zujian;
	Gongju gj;
	
	
	public AdapterCombo(Context context,List<Map<String,Object>> data){
		this.context=context;
		this.data=data;
		gj=Gongju.getdx(context);
	}
	
	class Zujian{
		TextView cb_text;
	}
	
	@Override
	public int getCount()
	{
		// TODO: Implement this method
		return data.size();
	}

	@Override
	public Object getItem(int p1)
	{
		// TODO: Implement this method
		return data.get(p1);
	}

	@Override
	public long getItemId(int p1)
	{
		// TODO: Implement this method
		return p1;
	}

	@Override
	public View getView(int position, View p2, ViewGroup p3)
	{
		if(p2==null){
			p2=LayoutInflater.from(context).inflate(R.layout.item_combo,null);
			zujian=new Zujian();
			zujian.cb_text=(TextView) p2.findViewById(R.id.cb_text);	
			p2.setTag(zujian);
		}else{
			zujian=(AdapterCombo.Zujian) p2.getTag();
		}
		zujian.cb_text.setText((String)data.get(position).get("combo"));
		
		// TODO: Implement this method
		return p2;
	}
	
	
	
}
